package com.yaojiaxun.logisticsPlatformSystem.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yaojiaxun.logisticsPlatformSystem.entity.PlatformInfo;
import org.apache.ibatis.annotations.*;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Auther: yjx_j
 * @Date: 2019/2/19 13:25
 * @Description:
 */
@Mapper
public interface PlatformInfoMapper extends BaseMapper<PlatformInfo> {
    @Select("select * from platform_info")
    public PlatformInfo selectPlatformInfo();

    @Insert("insert into platform_info(id, plat_name, plat_intro, plat_phone, plat_address, create_time, update_time) values(" +
            "#{platformInfo.id}, #{platformInfo.platName}, #{platformInfo.platIntro}, #{platformInfo.platPhone}, " +
            "#{platformInfo.platAddress}, #{platformInfo.createTime}, #{platformInfo.updateTime})")
    public Integer insertPaltformInfo(@Param("platformInfo") PlatformInfo platformInfo);

    @Update("update platform_info set plat_name=#{platName}, plat_intro=#{platIntro}, plat_phone=#{platPhone}, plat_address=#{platAddress}" +
            "where id=#{id}")
    public Integer updatePlatInfo(@RequestParam("platformInfo") PlatformInfo platformInfo);
}
